package com.emep.changzhi.analyse.repository.outlet;

import com.emep.changzhi.analyse.entity.basics.SysCompanyInfo;
import com.emep.changzhi.analyse.entity.outlet.SysOutletInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;

import javax.transaction.Transactional;
import java.util.List;
import java.util.Map;

/**
 * @author Wangcc
 * @version V1.0
 * @Description: 排口信息持久层
 * @date 2018/2/26 14:50
 */
public interface SysOutletInfoRepository extends JpaRepository<SysOutletInfo,Long>{

    SysOutletInfo findSysOutletInfoById(String id);

    @Modifying
    @Transactional
    Integer deleteById(String id);

    Page<SysOutletInfo> findAll(Specification< SysOutletInfo> spec, Pageable pageable);

    List<SysOutletInfo> findByOutletStatusAndCompany(String outletStatus, SysCompanyInfo sysCompanyInfos);

    List<SysOutletInfo> findSysOutletInfosByCompany(SysCompanyInfo sysCompanyInfo);

    /**
     * 获取企业排口的情况
     */
    List<SysOutletInfo> findAllByCompanyAndId(SysCompanyInfo sysCompanyInfo,String id);
}
